<template>
	<view class="performanceViewBox">
		<view class="performanceViewBoxTitle">业绩查看</view>
		<view class="performanceStatisticsBox">
			<view><text style="color:#f00;margin-right:10rpx;">*</text>
			<text style="vertical-align: middle;display: inline-block;">当月责任重消</text>
			<text style="vertical-align: middle;display: inline-block;" class="qualified" v-if="qualifyInfo">合格</text>
			<text style="vertical-align: middle;display: inline-block;" class="nonqualified" v-if="!qualifyInfo">不合格</text>
		</view>
			<view><text style="color:#f00;margin-right:10rpx;">*</text>上月净收入：{{monthQualify.lastMonth}}，本月还需要重消：{{monthQualify.availableAmount}}</view>
		</view>
		<view class="performanceViewBoxList">
			<view v-for="(ele,ind) in performanceViewBoxList" :key="ind">
				<view>{{ele.name}}</view>
				<view @click="gotoRouter(ele)">
					查看
					<text class='iconfont icon-xiangyou' style="margin-left:5rpx;"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getThreeMonths
	} from '@/api/directSelling.js';
	export default {
		data(){
			return {
				qualifyInfo:true,
				monthQualify:{},
				performanceViewBoxList:[{
					name:"实时明细",
					path:"/pages/directSellingPage/realTimeDetails/index",
					isJump: false,
				},{
					name:"日结明细",
					path:"/pages/directSellingPage/realTimeDetails/dayBonus",
					isJump: false,
				},{
					name:"周结明细",
					path:"/pages/directSellingPage/realTimeDetails/periodBonusDetails",
					isJump: false,
				},{
					name:"特殊补贴",
					path:"/pages/directSellingPage/realTimeDetails/specialShareBonus",
					isJump: false,
				},{
					name:"月结明细",
					path:"/pages/directSellingPage/realTimeDetails/monthBonusDetails",
					isJump: false,
				},{
					name:"业绩概况",
					path:"/pages/directSellingPage/performanceOverview/index",
					isJump: false,
				},{
					name:"分享顾客",
					path:"/pages/directSellingPage/shareCustomers/index",
					isJump: false,
					
				},{
					name:"注册顾客",
					path:"/pages/directSellingPage/shareCustomers/registMembers",
					isJump: false,
				}]
			}
		},
		mounted(){
			let userInfo = uni.getStorageSync('userInfo');
			if (userInfo.memberIdentity == 1){
			   this.qualifyInfo=true;
			}else{
				this.qualifyInfo=false;
			}
			this.getThreeMonths();
		},
		methods:{
			getThreeMonths(){
				getThreeMonths().then((res)=>{
					let data=res.data;
					this.monthQualify=data;
					if(this.qualifyInfo==true){
						this.monthQualify.availableAmount=0;
					}
				})
			},
			gotoRouter(ele){
				if (ele.isJump == false) {
					uni.navigateTo({
						url: ele.path
					});
				} else {
					uni.navigateTo({
						url: "/pages/user/memberCenterJumb?path=" + ele.path+"&title="+ele.name
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	body,page{
		background:#fff;
	}
	.performanceViewBox{
		width:100%;
		height:auto;
		padding:10rpx 30rpx;
		background:#fff;
		box-sizing: border-box;
		.performanceViewBoxTitle{
			color:#333333;
			font-weight: bold;
			font-size:60rpx;
			line-height:100rpx;
			margin-bottom:40rpx;
		}
		.performanceViewBoxList{
			>view{
				height:115rpx;
				line-height:115rpx;
				border-bottom:1px solid #ccc;
				color:#333;
				font-size:32rpx;
				display:flex;
				justify-content: space-between;
			}
		}
	}
	.performanceStatisticsBox{
		line-height:60rpx;
		.qualified{
			color:$theme-color;
			font-weight: bold;
			font-size:30rpx;
		}
		.nonqualified{
			color:#f00;
			font-size:30rpx;
			font-weight: bold;
		}
	}
</style>
